package com.hfzy.ihk.facade.linkcall.enums;

import com.hfzy.ihk.common.facade.CustomEnumType;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2018/7/19.
 *
 * @author wws
 */
public enum SpeakingPackageType implements CustomEnumType {

    NEW_HOUSE("n", "新房"),
    SECOND_HAND_HOUSE("s", "二手房");


    private SpeakingPackageType(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    private String value;

    private String desc;

    @Override
    public String getValue() {
        return value;
    }

    @Override
    public String getDesc() {
        return desc;
    }

    private static Map<String, SpeakingPackageType> map = new HashMap<>();
    static {
        for (SpeakingPackageType value : SpeakingPackageType.values()) {
            map.put(value.getValue(), value);
        }
    }

    public static SpeakingPackageType fromValue(String value) {
        SpeakingPackageType ret = map.get(value);
        if (ret != null) {
            return ret;
        } else {
            throw new IllegalArgumentException("No enum const " + SpeakingPackageType.class + "." + value);
        }
    }

}
